package com.oyo.common.enums;

/**
 * @Desc: 消费项目类型
 * @Author: sangbowei
 * @Description:
 * @Date: 2018/8/27 19:43
 */
public enum ConsumptionType {

	ROOM_RATE(1,"房费"),
	ROOM_RATE_EXTRA(2,"房费调整"),
	DEPOSIT(3,"押金"),
	PAY(4,"收款"),
	REFUND(5,"退款");

	int code;
	String name;

	ConsumptionType(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public static String getNameByCode(int code) {
		ConsumptionType[] types = values();
		for (ConsumptionType type : types) {
			if (type.getCode() == code) {
				return type.getName();
			}
		}
		return null;
	}

	public int getCode() {
		return code;
	}

	public String getName() {
		return name;
	}
}
